<html lang="zh-CN"><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户中心</title>
    <link rel="stylesheet" href="/campustradingwall_war_exploded/css/style.css">
    <link rel="stylesheet" href="/campustradingwall_war_exploded/css/layout.css">
</head>
<body>

<div class="main-container">




<aside class="sidebar">
    <div class="sidebar-header">
        <h3>导航菜单</h3>
    </div>
    <nav class="sidebar-nav">
        <a href="/campustradingwall_war_exploded/" class="">首页</a>




                <a href="/campustradingwall_war_exploded/user/profile" class="">用户中心</a>
                <a href="/campustradingwall_war_exploded/user/products" class="">我的商品</a>
                <a href="/campustradingwall_war_exploded/user/orders" class="">我的订单</a>
                <a href="/campustradingwall_war_exploded/user/messages" class="">我的消息</a>


    </nav>
</aside>

    <main class="content-area">




<header class="main-header">
    <h1>沈阳工程学院二手交易市场</h1>
    <div class="header-user-actions">


                <a href="/campustradingwall_war_exploded/user/profile" class="header-link">
                    <img src="/campustradingwall_war_exploded/uploads/avatars/3_1749299526941_adbdac3fe0b3ccdf18dcbe541ae5515.jpg" alt="头像" class="header-avatar">
                    <span>李沂杭</span>
                </a>
                <a href="/campustradingwall_war_exploded/user/messages" class="header-link message-notification">
                    我的消息

                </a>
                <a href="/campustradingwall_war_exploded/logout" class="header-link">退出登录</a>



    </div>
</header>

        <div class="page-title">
            <h2>用户中心</h2>
        </div>



            <p class="success-message">您不能购买自己发布的商品！</p>


        <div class="profile-section">
            <h3>个人信息</h3>
            <form action="/campustradingwall_war_exploded/user/updateProfile" method="post" enctype="multipart/form-data">
                <div class="form-group avatar-group">
                    <label>我的头像</label>
                    <img src="/campustradingwall_war_exploded/uploads/avatars/3_1749299526941_adbdac3fe0b3ccdf18dcbe541ae5515.jpg" alt="用户头像" class="current-avatar">
                    <input type="file" name="avatar" class="form-control-file">
                </div>
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" id="username" name="username" value="李沂杭" class="form-control">
                </div>
                 <div class="form-group">
                    <label for="phone">手机号</label>
                    <input type="text" id="phone" name="phone" value="13900139000" class="form-control">
                </div>
                <button type="submit" class="btn">保存信息</button>
            </form>
        </div>

        <div class="profile-section">
            <h3>修改密码</h3>
            <form action="/campustradingwall_war_exploded/user/updatePassword" method="post">
                <div class="form-group">
                    <label for="newPassword">新密码</label>
                    <input type="password" id="newPassword" name="newPassword" class="form-control" required="">
                </div>
                <div class="form-group">
                    <label for="confirmPassword">确认新密码</label>
                    <input type="password" id="confirmPassword" name="confirmPassword" class="form-control" required="">
                </div>
                <button type="submit" class="btn">更新密码</button>
            </form>
        </div>

        <div class="profile-section">
            <h3>收货地址管理</h3>
            <div class="address-list">

                    <div class="address-item">
                        <p>沈阳工程学院  计算机科学与技术学院  10号楼</p>
                        <a href="/campustradingwall_war_exploded/user/deleteAddress?id=3" class="btn-danger" onclick="return confirm('确定要删除这个地址吗？')">删除</a>
                    </div>


            </div>
            <form action="/campustradingwall_war_exploded/user/addAddress" method="post" class="add-address-form">
                 <div class="form-group">
                    <label for="newAddress">添加新地址</label>
                    <input type="text" id="newAddress" name="newAddress" class="form-control" required="">
                </div>
                <button type="submit" class="btn">添加地址</button>
            </form>
        </div>

        <div class="profile-section">
            <h3>我的评价</h3>
            <div class="rating-summary">
                <p>平均评分:



                            暂无评分


                </p>
            </div>

            <div class="received-ratings-list">
                <h4>收到的所有评价</h4>



                        <p>您目前还没有收到任何评价。</p>


            </div>
        </div>

    </main>
</div>
<script>
    // 简单的密码确认逻辑
    const passwordForm = document.querySelector('form[action$="updatePassword"]');
    passwordForm.addEventListener('submit', function(e) {
        const newPassword = document.getElementById('newPassword').value;
        const confirmPassword = document.getElementById('confirmPassword').value;
        if (newPassword !== confirmPassword) {
            e.preventDefault();
            alert('两次输入的新密码不一致！');
        }
    });
</script>

 </body></html>